﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
	<base href="<%=basePath%>">
	<!-- jsp文件头和头部 -->
	<%@ include file="../main/main_top.jsp"%> 
	<link type="text/css" rel="stylesheet" href="plugins/zTree/css/zTreeStyle/zTreeStyle.css"/>
	<script type="text/javascript" src="plugins/zTree/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="plugins/zTree/js/jquery.ztree.core-3.5.js"></script>
	  <SCRIPT type="text/javascript" >
	  $(top.hangge());
	  <!--
		var zTree;
		var demoIframe;
	
		var setting = {
			view: {
				dblClickExpand: false,
				showLine: true,
				selectedMulti: false
			},
			data: {
				simpleData: {
					enable:true,
					idKey: "table_constants_id",
					pIdKey: "parent_id",
					rootPId: ""
				}
			},
			callback: {
				beforeClick: function(treeId, treeNode) {
					demoIframe.attr("src",treeNode.file + ".do?currentselecttableconstantsid=" + treeNode.table_constants_id);
					return true;
				}
			}
		};
	
		var zn = '${zTreeNodes}';
		var zNodes = eval(zn);
		
		$(document).ready(function(){
			var t = $("#tree");
			t = $.fn.zTree.init(t, setting, zNodes);
			demoIframe = $("#testIframe");
			demoIframe.bind("load", loadReady);
			//默认选中节点
			//var zTree = $.fn.zTree.getZTreeObj("tree");
			//zTree.selectNode(zTree.getNodeByParam("id", 101));
			var currentselecttableconstantsid = '${currentselecttableconstantsid}';
			demoIframe.attr("src","<%=basePath%>/tableConstants/listTableConstantsData.do?currentselecttableconstantsid=" + currentselecttableconstantsid);
		});
	
		function loadReady() {
			var bodyH = demoIframe.contents().find("body").get(0).scrollHeight,
			htmlH = demoIframe.contents().find("html").get(0).scrollHeight,
			maxH = Math.max(bodyH, htmlH), minH = Math.min(bodyH, htmlH),
			h = demoIframe.height() >= maxH ? minH:maxH ;
			if (h < 530) h = 530;
			demoIframe.height(h);
		}
	  //-->
	  </SCRIPT>
	</head> 
<body>
	<div class="container-fluid" id="main-container">
		<div id="breadcrumbs">
			<ul class="breadcrumb">
				<li><i class="icon-home"></i> <a>商户管理</a><span class="divider"><i class="icon-angle-right"></i></span></li>
				<li class="active">桌台类型</li>
			</ul><!--.breadcrumb-->
			<div id="nav-search">
			</div><!--#nav-search-->
		</div><!--#breadcrumbs-->
		<div id="page-content" class="clearfix">
			<div class="row-fluid">
				<div class="widget blue">
					<div class="widget-title">
			            <h4><i class="icon-reorder"></i>类型树</h4>
			        </div>
					<!-- 检索  -->
					<div class="widget-body">
	                    <!-- BEGIN FORM-->
	                    <div class="row-fluid">
							<div id="content">
								<table border=0 align=left height="800px">
									<tr>
										<td width=10% align=left valign=top style="BORDER-RIGHT: #999999 1px dashed">
											<ul id="tree" class="ztree" style="width:200px; overflow:auto;"></ul>
										</td>
										<td width=90% align=left valign=top class="offset2">
											<iframe id="testIframe" name="testIframe" frameborder=0 scrolling=auto width=100%  height=800px ></iframe>
										</td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</div>
			<!-- PAGE CONTENT ENDS HERE -->
		  	</div><!--/row-->
		</div><!--/#page-content-->
	</div><!--/.fluid-container#main-container-->
	</body>
</html>